<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [10,20,30,40,50]
        var res = arr.slice(1,4)
        console.log(arr)
        console.log(res) //20,30,40

        var arr1 = [10,20,30,40,50]
        var arr2 = [60,70,80,90]
        var res1 = arr.concat(arr2,"hello",true)
        console.log(res1)
        //concat会将数组内的元素拆分出来合并

        console.log("===========================================================")
        var arr3 = [10,20,30,40,50]
        var res2 = arr3.splice(1,0,"hello","world")
        console.log(arr3)
        console.log(res2)
        //以上为splice 的增加功能
        var res3 = arr3.splice(1,2)
        console.log(arr3 + "delete")
        console.log(res3 + "delete")
        //splice的删除功能
        var res4 = arr3.splice(2,1,"hello")
        console.log(arr3)
        console.log(res4)
        //修改功能（先删除，后增加）

        console.log("===========================================================")
        var arr4=[10,20,30,40,50]
        var res5 = arr4.join("==xx")
        console.log(res5)
        console.log(arr4)
        //join功能

        var arr5=[1,10,20,15,25,5]
        arr5.sort
        console.log(arr5)
        //按照字符串大小排列
        arr5.sort(function(a,b){
            return a-b
        })
        console.log(arr5)
        //按照数字大小（ASCII码）排序
        </script>
</head>
<body>
    
</body>
</html>